package com.zhongyu.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhongyu.pojo.Order;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface LuRuMapper extends BaseMapper<Order> {

    @Select("SELECT t1.*, t2.pro_Name,t3.username FROM smbms_order t1 JOIN smbms_provider t2 ON t1.provider_id=t2.id  JOIN smbms_user t3 ON t1.creator=t3.id where type=2  ")
    @ResultMap("providerRm")
    List<Order> findAll(Page page);
    @Select("SELECT t1.*, t2.pro_Name FROM smbms_order t1 JOIN smbms_provider t2 ON t1.provider_id=t2.id where t1.id=#{id} ")
    @ResultMap("providerRm")
    List<Order> searchAll(Integer id);
}
